# -*- encoding: utf-8 -*-
# 11:32 2021/12/06
# Kay
from flask import Flask
from flask_migrate import Migrate

from models import db
from views.users import user

migrate = Migrate()


def create_app(config):
    app = Flask(__name__)
    # 加载配置
    app.config.from_object(config)
    # 数据库
    db.init_app(app)
    migrate.init_app(app, db)
    # 日志
    # 蓝图
    app.register_blueprint(user, url_prefix='/v1/api/users')
    return app
